/*
 * @Description: 
 * @Date: 2023-05-29 14:29:31
 * @LastEditors: yrg
 * @LastEditTime: 2023-05-29 14:42:30
 * @FilePath: \cesium-wind-field\src\utils\initMap.js
 */
/**
 * 初始化三维球
*/
export function initMap() {
  var token = "85e9525dae7042775b764346311a93e6";
  // 服务域名
  var tdtUrl = "https://t{s}.tianditu.gov.cn/";
  // 服务负载子域
  var subdomains = ["0", "1", "2", "3", "4", "5", "6", "7"];
  var imgMap = new Cesium.UrlTemplateImageryProvider({
    url: tdtUrl + "DataServer?T=img_w&x={x}&y={y}&l={z}&tk=" + token,
    subdomains: subdomains,
    tilingScheme: new Cesium.WebMercatorTilingScheme(),
    maximumLevel: 18,
  });
  // cesium 初始化
  var viewer = new Cesium.Viewer("cesiumContainer", {
    shouldAnimate: false,
    selectionIndicator: false,
    infoBox: false,
    imageryProvider: imgMap,
    animation: false, //动画
    baseLayerPicker: false, //图层选择控件
    timeline: false, //时间轴
    geocoder: false,
    homeButton: true,
    navigationHelpButton: false, // 取消右上角的问号 
  });
  //地形夸张
  viewer.scene.globe.terrainExaggeration = 30;
  window.viewer = viewer;
  window.scene = viewer.scene;
}